<template>
	<view class="wallet-page">
		<u-navbar leftIconColor="#fff" :autoBack="true" :placeholder="true" bgColor="rgba(255,255,255,0.0)">
			<view slot="center" class="nav-title">
				钱包
			</view>
		</u-navbar>
		<view class="head-box">
			<view class="head-text">
				钱包余额
			</view>
			<view class="head-num">
				378483
			</view>
			<view class="wallet-tab">
				<view :class="current == index?'active-item': 'tab-item'" class="tab-item"
					v-for="(item,index) in tabList" :key="index" @click="cutTab(index,item.url)">
					<image :src="item.img" mode=""></image>
					<view class="tab-text">
						{{item.text}}
					</view>
				</view>
			</view>
		</view>
		<view class="balance">
			<view class="balance-title">
				利息宝余额
			</view>
			<view class="balance-num">
				578743
			</view>
			<view class="revenue">
				<view class="revenue-item">
					<view class="revenue-text">
						昨日收益
					</view>
					<view class="revenue-num">
						356.22
					</view>
				</view>
				<view class="revenue-item">
					<view class="revenue-text">
						收益率(日)
					</view>
					<view class="revenue-num">
						2%
					</view>
				</view>
				<view class="revenue-item">
					<view class="revenue-text">
						总收益
					</view>
					<view class="revenue-num">
						2942
					</view>
				</view>
			</view>
			<view class="btn-box">
				<view class="btn">
					<image src="/static/my/out.png" mode=""></image>
					<view class="btn-text">
						转出
					</view>
				</view>
				<view class="btn right">
					<image src="/static/my/enter.png" mode=""></image>
					<view class="btn-text">
						转入
					</view>
				</view>
			</view>
		</view>
		<view class="info">
			<view class="info-item">
				<view class="info-left">
					<view class="info-num">
						充值钱包到余额
					</view>
					<view class="info-time">
						2025.06.20 15：30
					</view>
				</view>
				<view class="info-stutas">
					<text class="add">
						+1333
					</text>
				</view>
			</view>
			<view class="info-item">
				<view class="info-left">
					<view class="info-num">
						购买商品
					</view>
					<view class="info-time">
						2025.06.20 15：30
					</view>
				</view>
				<view class="info-stutas">
					<text class="reduce">
						-333
					</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabList: [{
						img: '/static/my/icon1.png',
						text: '提现',
						url:'/pages/my/withdraw/index'
					},
					{
						img: '/static/my/icon2.png',
						text: '转移'
					},
					{
						img: '/static/my/icon3.png',
						text: '充值',
						url:'/pages/my/top_up/index'
					}
				],
				current: 2,
			}
		},
		methods: {
			cutTab(index,url) {
				this.current = index
				uni.navigateTo({
					url:url
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #000000;
	}
</style>
<style lang="scss" scoped>
	.wallet-page {
		padding: 0 20rpx;

		.nav-title {
			color: #ffffff;
		}

		.head-box {
			border: 1rpx solid rgba(255, 255, 255, .2);
			padding: 30rpx;
			margin-top: 40rpx;
			border-radius: 20rpx;

			.head-text {
				font-size: 26rpx;
				color: #818181;
			}

			.head-num {
				font-size: 54rpx;
				font-weight: bold;
				color: #e3c6b1;
			}

			.wallet-tab {
				display: flex;
				justify-content: space-around;
				align-items: center;
				margin-top: 30rpx;

				.tab-item {
					width: 31%;
					display: flex;
					align-items: center;
					justify-content: center;
					border: 1rpx solid rgba(255, 255, 255, .2);
					padding: 20rpx 0;
					border-radius: 20rpx;
					color: #ffffff;

					image {
						width: 30rpx;
						height: 30rpx;
					}

					.tab-text {
						font-size: 26rpx;
						margin-left: 10rpx;
					}
				}

				.active-item {
					background: linear-gradient(to right, #d8b69d 0%, #fcecde 100%);
					color: #000000;
					border: none;
				}
			}
		}

		.balance {
			padding: 20rpx;
			border-radius: 20rpx;
			background-color: #d8b69d;
			margin-top: 30rpx;

			.balance-title {
				font-size: 26rpx;
				color: #010101;
			}

			.balance-num {
				font-size: 48rpx;
				font-weight: bold;
				color: #4f2b0f;
			}

			.revenue {
				display: flex;
				justify-content: space-between;

				.revenue-item {
					margin-top: 20rpx;

					.revenue-text {
						color: #010101;
						font-size: 26rpx;
					}

					.revenue-num {
						color: #000000;
						font-size: 34rpx;
						font-weight: bold;
					}
				}
			}

			.btn-box {
				display: flex;
				justify-content: space-between;
				margin-top: 20rpx;

				.btn {
					width: 48%;
					color: #ffffff;
					display: flex;
					align-items: center;
					justify-content: center;
					background-color: rgba(0, 0, 0, .15);
					border-radius: 20rpx;
					padding: 20rpx;

					image {
						width: 35rpx;
						height: 35rpx;
						margin-right: 10rpx;
					}
				}

				.right {
					background-color: #000000;
				}
			}
		}
		.info {
			background-color: #1a1a1b;
			padding: 20rpx 30rpx 30rpx;
			border-radius: 20rpx;
			margin-top: 30rpx;
			.info-item {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-bottom: 30rpx;
				border-bottom: 1rpx solid rgba(255, 255, 255, .1);
				margin-top: 20rpx;
		
				.info-left {
					.info-num {
						font-size: 30rpx;
						color: #ffffff;
					}
		
					.info-time {
						color: #8f8f8f;
						font-size: 26rpx;
					}
				}
		
				.info-stutas {
					color: #8f8f8f;
					font-size: 30rpx;
		
					.add {
						color: #ffd7a2;
					}
		
					.reduce {
						color: #ffffff;
					}
				}
			}
		}
	}
</style>